package com.lam.task;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lam.common.utils.DateUtil;
import com.lam.schedule.common.scheduler.annotation.TaskTarget;
import com.lam.task.service.SystemService;

@TaskTarget
@Service
public class SystemServiceTask {
	
	@Autowired
	private SystemService systemService;
	
	@TaskTarget
	public void clearScheduleLog(Map<String, Object> param) {

		//清理90天前的定时调度日志
		systemService.deleteScheduleLog(DateUtil.getDurationDateStr(-90));
	}
	
	@TaskTarget
	public void clearOperLog(Map<String, Object> param) {
		//清理90天前的操作日志
		systemService.deleteOperLog(DateUtil.getDurationDateStr(-90));
	}
	
	@TaskTarget
	public void clearFileRecord(Map<String, Object> param) {

		//更改过期的文件状态
		systemService.updateFileStatus();
		//清理过期7天的文件记录
		systemService.deleteFileRecord(7);
	}
	

}
